package com.celesea.auth.role.entity;

import com.celesea.auth.role.vo.RoleVo;
import com.celesea.framework.entity.BaseEntity;
import com.celesea.framework.util.EnvUtil;
import com.celesea.framework.vo.DictionaryVo;

import javax.persistence.Column;
import javax.persistence.Table;

@Table(name = "role_user_mapping")
public class RoleUser extends BaseEntity {

    @Column(name = "`user_id`", columnDefinition = "用户Id")
    private String userId;
    @Column(name = "`user_name`", columnDefinition = "用户名称")
    private String userName;
    @Column(name = "`role_id`", columnDefinition = "角色Id")
    private String roleId;
    @Column(name = "`role_name`", columnDefinition = "角色名称")
    private String roleName;

    public RoleUser() {
    }

    public RoleUser(RoleVo role, DictionaryVo item) {
        super.tenantId= EnvUtil.getTenantId();
        this.userId = item.getId();
        this.userName = item.getName();
        this.roleId = role.getId();
        this.roleName = role.getName();
    }

    public String getRoleId() {
        return roleId;
    }

    public void setRoleId(String roleId) {
        this.roleId = roleId;
    }

    public String getRoleName() {
        return roleName;
    }

    public void setRoleName(String roleName) {
        this.roleName = roleName;
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

}
